From: Jasper St. Pierre Date: Sun, 19 Aug 2012 23:12:02 +0000 (-0400) Subject: grabHelper: Make sure to return not null when the stack contains fake grabs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6122 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=eebab34b62ee0c78e99f29e628032f04d511887e;p=gnome-shell.git grabHelper: Make sure to return not null when the stack contains fake grabs We did this if there's nothing in the grab stack, but didn't do this when there's no real grabs in the grab stack. --- diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js index 4a72351bb..ac6535128 100644 --- a/js/ui/grabHelper.js +++ b/js/ui/grabHelper.js @@ -84,14 +84,11 @@ const GrabHelper = new Lang.Class({ }, get currentGrab() { - if (!this._grabStack.length) - return {}; - let idx = this._grabStack.length - 1; while (idx >= 0 && this._grabStack[idx].untracked) idx--; - return this._grabStack[idx]; + return this._grabStack[idx] || {}; }, _findStackIndex: function(actor) {